package com.design.mode.prototype;

import javax.swing.*;
import java.awt.*;

/**
 * @ClassName Client
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/9/28 11:30
 **/
public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {

        RealizType realizType = new RealizType();

        RealizType copy = (RealizType) realizType.clone();

        System.out.println("realizType == copy ? " + (copy == realizType));


        JFrame jFrame = new JFrame("原型拷贝");
        jFrame.setLayout(new GridLayout(1,2));
        Container container = jFrame.getContentPane();

        CopySimilar copySimilar = new CopySimilar();
        container.add(copySimilar);
        CopySimilar copySimilar1 = (CopySimilar) copySimilar.clone();
        container.add(copySimilar1);
        jFrame.pack();
        jFrame.setVisible(true);
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


    }
}
